import {DbContext} from '@codefree/badger/service'

const db = DbContext.Sequelize;

export type AuthUserEntity = {
    username: String,
    password: Number,
    active: Boolean
}

const authUserEntity:AuthUserEntity = {
    username: db.STRING(50),
    password: db.STRING,
    active: {
        type: db.BOOLEAN,
        defaultValue: true
    }
};

export default (sequelize) => {
    return {
        name: 'AuthUser',
        define: sequelize.define("auth_user", authUserEntity, DbContext.defaultOptions)
    }
}